Skip to content

gh-125522: Fix bare except in test_math.testTan#125544

Merged
iritkatriel merged 4 commits into
python:mainfrom
iritkatriel:test_math
Oct 19, 2024
Merged

gh-125522: Fix bare except in test_math.testTan#125544
iritkatriel merged 4 commits into
python:mainfrom
iritkatriel:test_math

Conversation

@iritkatriel

@iritkatriel iritkatriel commented Oct 15, 2024

Copy link
Copy Markdown
Member

This is a simple rewrite of the test to avoid bare except and make the test's intention clearer

Comment thread Lib/test/test_math.py Outdated
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
@iritkatriel iritkatriel changed the title gh-125522: rewrite test_math.testTan to clarify intention gh-125522: Add exception type in try-exception in test_math.testTan Oct 18, 2024
@iritkatriel iritkatriel changed the title gh-125522: Add exception type in try-exception in test_math.testTan gh-125522: Fix bare except in test_math.testTan Oct 18, 2024
@serhiy-storchaka serhiy-storchaka added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Oct 19, 2024

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@skirpichev

Copy link
Copy Markdown
Member

@serhiy-storchaka, what do you think on keeping only self.assertRaises?

@serhiy-storchaka

Copy link
Copy Markdown
Member

I think that this test implies that NaN is a valid returning value. If we want to change this, open a separate issue. It should be discussed with Mark and Tim.

@iritkatriel iritkatriel merged commit 4b421e8 into python:main Oct 19, 2024
@miss-islington-app

Copy link
Copy Markdown

Thanks @iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 19, 2024
(cherry picked from commit 4b421e8)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 19, 2024
(cherry picked from commit 4b421e8)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
@bedevere-app

bedevere-app Bot commented Oct 19, 2024

Copy link
Copy Markdown

GH-125726 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Oct 19, 2024
@bedevere-app

bedevere-app Bot commented Oct 19, 2024

Copy link
Copy Markdown

GH-125727 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Oct 19, 2024
iritkatriel added a commit that referenced this pull request Oct 19, 2024
…125727)

gh-125522: Fix bare except in test_math.testTan (GH-125544)
(cherry picked from commit 4b421e8)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
iritkatriel added a commit that referenced this pull request Oct 19, 2024
…125726)

gh-125522: Fix bare except in test_math.testTan (GH-125544)
(cherry picked from commit 4b421e8)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants